package com.whfc.ms.api.emp.controller;

import com.whfc.common.result.PageData;
import com.whfc.common.result.Result;
import com.whfc.common.result.ResultUtil;
import com.whfc.common.util.SessionAttr;
import com.whfc.emp.dto.AppEmpRiskDTO;
import com.whfc.fuum.entity.SysUser;
import com.whfc.ms.api.emp.service.MsAppEmpRiskService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 人员风险告知书
 *
 * @author qzexing
 * @version 1.0
 * @date 2021/9/29 17:20
 */
@RestController
@RequestMapping("/ms/api/risk")
public class AppEmpRiskController {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private MsAppEmpRiskService msAppEmpRiskService;

    @GetMapping("/list")
    public Result list(@SessionAttribute(SessionAttr.MS_USER) SysUser user,
                       @RequestParam("empId") Integer empId,
                       @RequestParam("pageNum") Integer pageNum,
                       @RequestParam("pageSize") Integer pageSize) {
        logger.info("获取风险告知书列表，loginer:{},empId:{},pageNum:{}, pageSize:{}", user.getUsername(), empId, pageNum, pageSize);
        PageData<AppEmpRiskDTO> pageData = msAppEmpRiskService.list(empId, pageNum, pageSize);
        return ResultUtil.success(pageData);
    }


}
